import React, { Component } from 'react';
import '../styles/Index.scss'

import Home from './Index/Home';
import Cate from './Index/Cate';
import News from './Index/News'
import TicketHolder from './Index/TicketHolder'
import Mine from './Index/Mine'
import Tabbar from '../components/Tabbar';
import NotFound from './NotFound';

import { Redirect, Route, Switch } from "react-router-dom";

class Index extends Component {
    render() {
        return (
            <div className='index'>
                <Switch>
                    <Route exact path="/index/home" component={ Home}></Route>
                    <Route exact path="/index/cate" component={ Cate}></Route>
                    <Route exact path="/index/ticketholder" component={ TicketHolder}></Route>
                    <Route exact path="/index/news" component={ News}></Route>
                    <Route exact path="/index/mine" component={ Mine}></Route>
                    <Redirect exact from='/index' to="/index/home"></Redirect>
                    <Route path="*" component={NotFound}></Route>
                </Switch>
                <Tabbar></Tabbar>
            </div>
        );
    }
}

export default Index;